/*===========================================================================+
 |   Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA    |
 |                         All rights reserved.                              |
 +===========================================================================+
 |  HISTORY                                                                  |
 +===========================================================================*/
package sza.oracle.apps.ap.oie.traveExp.webui;

import oracle.apps.ap.oie.entry.webui.EntryFlowPageCO;
import oracle.apps.ap.oie.framework.webui.OIEPageCO;
import oracle.apps.ap.oie.webui.NavigationUtility;
import oracle.apps.fnd.common.MessageToken;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean;
import oracle.apps.fnd.framework.webui.beans.nav.OATrainBean;

import oracle.cabo.ui.collection.UINodeList;

import sza.oracle.apps.ap.oie.utility.SzaOIEUtil;

/**
 * Controller for ...
 */
public class TravelCO extends OAControllerImpl
{
  public static final String RCS_ID="$Header$";
  public static final boolean RCS_ID_RECORDED = 
        VersionInfo.recordClassVersion(RCS_ID, "%packagename%");

  /**
   * Layout and page setup logic for a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processRequest(pageContext, webBean);
      
//          String str = pageContext.getParameter("SDP_CALLING_MODULE");
//          if (!"CONFIRMATION".equals(str))
//          {
//            pageContext.getPageLayoutBean().setLocation(createWebBean(pageContext, "appsentryEntryTrainRN", null, true));
//      
//            EntryFlowPageCO.renderTrain(pageContext);
//          }
//      
//          String CurrentPage = NavigationUtility.getCurrentPage(pageContext);
//          System.out.println("Currentpage :"+CurrentPage);
//          if (CurrentPage.equals("TravelDetailPG"))
//          {
//            CurrentPage = "CashAndOtherLinesPG";
//          }
//        OATrainBean oATrainBean = (OATrainBean)pageContext.getPageLayoutBean().getLocation();
//      
//          UINodeList localUINodeList = oATrainBean.getIndexedNodeList();
//      
//          int i = 0;
//          int j = 0;
//          while ((j == 0) && (i < localUINodeList.size(pageContext.getRenderingContext())))
//          {
//            OAWebBean localOAWebBean = (OAWebBean)localUINodeList.getUINode(pageContext.getRenderingContext(), i);
//      
//            if (localOAWebBean.getID().equals(CurrentPage))
//              j = 1;
//            else
//              i++;
//          }
//          oATrainBean.setMaxVisited(i);
//          oATrainBean.setSelectedIndex(i);
//          System.out.println("localUINodeList.getUINode:" + i);
//      
//          NavigationUtility.checkStateLossError(pageContext);
//      
//          OIEPageCO.processContactUs(pageContext);
//          OIEPageCO.renderCCMenu(pageContext, webBean);
//      
//          OIEPageCO.renderProjectsAndTasks(pageContext, webBean);
//      
//          String LineClicked = pageContext.getParameter("LineClicked");
//      
//          MessageToken[] arrayOfMessageToken = { new MessageToken("LINE", LineClicked) };
//      
//          String localObject3 = pageContext.getMessage("SQLAP", "SZA_OIE_EXPENSE_TYPE_TITLE", arrayOfMessageToken);
//      
//          OAPageLayoutBean oAPageLayoutBean = (OAPageLayoutBean)webBean;
//          oAPageLayoutBean.setTitle(localObject3);
  }

  /**
   * Procedure to handle form submissions for form elements in
   * a region.
   * @param pageContext the current OA page context
   * @param webBean the web bean corresponding to the region
   */
  public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);
  }

}
